home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / jointToolValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.2 KB  |  122 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //    MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //    Creation Date:    Jan. 7, 1997
  22. //    Author:            ap
  23. //
  24. //    Description:    initializes jointContext tool property sheet
  25. //                    values
  26. //
  27. //    Input Arguments:
  28. //        toolName  - this is the name of the instance of the tool
  29. //                    that the property sheet is modifying.
  30. //
  31. //    Return Value:
  32. //        None.
  33. //
  34.  
  35.  
  36. global proc jointToolValues( string $toolName )
  37. {
  38.     string    $parent = (`toolPropertyWindow -q -location` + "|jointTool");
  39.     setParent    $parent;
  40.     string        $s;
  41.     int            $i;
  42.     int            $select;
  43.  
  44.     string $icon = "kinJoint.xpm";
  45.     string $helpTag = "JointTool";
  46.     toolPropertySetCommon $toolName $icon $helpTag;
  47.  
  48.     //    Degrees of Freedom
  49.     //
  50.     string $dof = `jointCtx -q -dJ $toolName`;
  51.  
  52.     if ("" != match("none", $dof)) {
  53.         checkBoxGrp -e -v1 off jpDofCheckBoxGrp;
  54.         checkBoxGrp -e -v2 off jpDofCheckBoxGrp;
  55.         checkBoxGrp -e -v3 off jpDofCheckBoxGrp;
  56.     } else {
  57.         if ("" != match("x", $dof)) {
  58.             checkBoxGrp -e -v1 on jpDofCheckBoxGrp;
  59.         } else {
  60.             checkBoxGrp -e -v1 off jpDofCheckBoxGrp;
  61.         }
  62.  
  63.         if ("" != match("y", $dof)) {
  64.             checkBoxGrp -e -v2 on jpDofCheckBoxGrp;
  65.         } else {
  66.             checkBoxGrp -e -v2 off jpDofCheckBoxGrp;
  67.         }
  68.  
  69.         if ("" != match("z", $dof)) {
  70.             checkBoxGrp -e -v3 on jpDofCheckBoxGrp;
  71.         } else {
  72.             checkBoxGrp -e -v3 off jpDofCheckBoxGrp;
  73.         }
  74.     }
  75.  
  76.     string $ajo = `jointCtx -q -ajo $toolName`;
  77.     string $ajoList[] = `optionMenuGrp -q -ils autoJointOrient`;
  78.     for ( $i = 0; $i < size($ajoList); $i++ ) {
  79.         $s = `menuItem -q -l $ajoList[$i]`;
  80.         if ($s == $ajo ) {
  81.             $select = $i + 1;
  82.             optionMenuGrp -e -sl $select autoJointOrient;
  83.         }
  84.     }
  85.  
  86.     // scaleCompensate
  87.     $select = `jointCtx -q -scJ $toolName`;
  88.     if( $select )
  89.         checkBoxGrp -e -v1 1 scaleCompensate;
  90.     else
  91.         checkBoxGrp -e -v1 0 scaleCompensate;
  92.  
  93.     // autoLimits
  94.     $select = `jointCtx -q -jal $toolName`;
  95.     if( $select )
  96.         checkBoxGrp -e -v1 1 autoLimits;
  97.     else
  98.         checkBoxGrp -e -v1 0 autoLimits;
  99.  
  100.     // createIKHandle
  101.     $select = `jointCtx -q -ikh $toolName`;
  102.     if( $select )
  103.     {
  104.         checkBoxGrp -e -v1 1 createIKHandle;
  105.         frameLayout -e -en true -cl false ikHandleFrame;
  106.     }
  107.     else
  108.     {
  109.         checkBoxGrp -e -v1 0 createIKHandle;
  110.         frameLayout -e -en false -cl true ikHandleFrame;
  111.     }
  112.  
  113.     // for ikHandleValues.
  114.     //
  115.     ikHandleOptionValues( $toolName, "jointCtx" );
  116.  
  117.     toolPropertySelect jointTool;
  118.  
  119.     return;
  120. }
  121.  
  122.